<script lang="ts" setup>
  import PhoneModel from './components/PhoneModel/index.vue'
  import Setting from './components/Setting/index.vue'
  import { CodeScanSet } from './types'
  import { ref } from 'vue'
  import routeComponentName from '@/config/route-component-name'

  defineOptions({
    name: routeComponentName.setting.snCodeScannerSet,
  })

  // 数据源
  const sets = ref<Array<CodeScanSet>>([])

  // 获取表单数据
  const handleGetForm = (data: Array<CodeScanSet>) => {
    sets.value = data
  }
</script>

<template>
  <div class="app-container code-scanning">
    <div class="app-container-inner code-scanning-inner">
      <div class="set_container">
        <Setting @get-form="handleGetForm" />
      </div>
      <div class="mobile">
        <PhoneModel :sets="sets" />
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
  .code-scanning {
    .code-scanning-inner {
      height: 86vh;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 5vw;
    }
  }
</style>
